const fetch = require('node-fetch')

fetch('https://api.github.com/users/ruanyf')
  .then(response => response.json())
  .then(json => console.log(json))// 异步操作
  .catch(err => console.log('Request Failed', err)); 